//
//  SetAccViewController.m
//  BGM
//
//  Created by liuqin on 2018/11/28.
//  Copyright © 2018年 com.alirtc.demo. All rights reserved.
//

#import "SetAccViewController.h"
#import "Common.h"
#import "MeTableViewCell.h"
#import "ChangePhoneNumViewController.h"
@interface SetAccViewController ()<UITableViewDataSource,UITableViewDelegate>
@property (nonatomic, copy)NSArray *messageArray;

@end

@implementation SetAccViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navview.hidden = NO;
    self.titleBtn.hidden = NO;
    CGRect rect = self.titleBtn.frame;
    rect.size.width = rect.size.width+70;
    self.titleBtn.frame = rect;
    [self.titleBtn setTitle:@"账号与安全" forState:UIControlStateNormal];
    self.messageArray = @[@"更改绑定手机",@"注销账号"];
    UITableView *myTableView = [[UITableView alloc]initWithFrame:CGRectMake(0, self.navview.frame.size.height, SCREENW, SCREENH-self.navview.frame.size.height)];
    myTableView.backgroundColor = [UIColor clearColor];
    myTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    myTableView.delegate = self;
    myTableView.dataSource = self;
    myTableView.scrollEnabled = NO;
    [self.view addSubview:myTableView];
}
#pragma mark UITABLEVIEWDELEAGE
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 2;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 50;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *identifier = @"MeTableViewCell";
    MeTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
    if (cell == nil) {
        cell = [[MeTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
        cell.iconBtn.hidden = NO;
        cell.contentLabel.frame = CGRectMake(15, 0, 300, 50);
        cell.line.hidden = YES;
    }
    cell.contentLabel.text =[self.messageArray objectAtIndex:indexPath.row];
    if (indexPath.row==0) {
        cell.rightBtn.hidden  = NO;

    }else{
        cell.rightBtn.hidden  = YES;
    }
    
    
    
    return cell;
    
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.row ==0) {
        
        ChangePhoneNumViewController *VC = [[ChangePhoneNumViewController alloc]init];
        [self.navigationController pushViewController:VC animated:YES];
        
    }else if (indexPath.row ==1){
        
    }
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
